import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ExpertiseForm, ExpertiseQuery, ExpertiseVO } from './types';

// 查询字典数据列表
export function listExpertiseData(query: ExpertiseQuery): AxiosPromise<ExpertiseVO[]> {
  return request({
    url: '/lawyer/lawFirm/listExpertise',
    method: 'get',
    params: query
  });
}

// 查询字典数据详细
export function getExpertise(dictCode: string | number): AxiosPromise<ExpertiseVO> {
  return request({
    url: '/lawyer/lawFirm/expertise/' + dictCode,
    method: 'get'
  });
}

// 新增字典数据
export function addExpertise(data: ExpertiseForm) {
  return request({
    url: '/lawyer/lawFirm/createExpertise',
    method: 'post',
    data: data
  });
}

// 修改字典数据
export function updateExpertise(data: ExpertiseForm) {
  return request({
    url: '/lawyer/lawFirm/updateExpertise',
    method: 'post',
    data: data
  });
}

// 删除字典数据
export function delExpertise(dictCode: string | number | Array<string | number>) {
  return request({
    url: '/lawyer/lawFirm/removeExpertise/' + dictCode,
    method: 'delete'
  });
}
